home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / Roaster-Java-WA-HTTP-CGI hack / cgi WA plugin / Interfaces / ArrangeCallbacks.h next >
Encoding:
C/C++ Source or Header  |  1996-06-22  |  40.3 KB  |  1,094 lines  |  [TEXT/MPS ]

  1. #ifndef ARRANGECALLBACKS_H
  2. #define ARRANGECALLBACKS_H
  3.  
  4. #ifdef __MWERKS__
  5. // CW7 functions return pointers in A0 unless this is specified. We specify it here because
  6. // Arrange returns pointers in D0 as per MPW conventions.
  7. #pragma pointers_in_D0
  8. #endif    //__MWERKS__
  9.  
  10. #include "ArrangeModule.r.h"
  11. #include "Module.h"
  12.  
  13.  
  14. typedef struct FSSpec FSSpec;
  15.  
  16.  
  17. /* This flag controls code used to help debug plugin modules.  The affected
  18.  * code is mostly concerned with providing error messages when a module
  19.  * passes bad parameters into a callback function.
  20.  */
  21. #ifndef ArrangeModuleDebug
  22. #define ArrangeModuleDebug ModuleDebug
  23. #endif
  24.  
  25.  
  26. /* Error values returned from GetFieldDate and GetFieldNumber if the field
  27.  * isn't present.
  28.  */
  29. #define missingDateToken 0
  30. #define missingNumToken  -1E20
  31.  
  32.  
  33. // Types used in the Arrange-specific callback functions.
  34.  
  35. // An arDocumentPtr refers to a currently open document.
  36. class arDocument;
  37. typedef arDocument* arDocumentPtr;
  38.  
  39. typedef Integer  arNoteID;   // Identifies a note or system object
  40. typedef arNoteID arFieldID;  // Identifies a field definition
  41. typedef arNoteID arTypeID;   // Identifies a note type definition
  42. typedef arNoteID arTopicID;  // Identifies a topic, folder, or view
  43. typedef arNoteID arWindowID; // Identifies a document or browser window
  44.                                       // (including hidden windows).
  45.  
  46.  
  47. // Globally unique identifier for a note or other object
  48. struct arGlobalID { uInteger data[3]; };
  49.  
  50. typedef uInteger arDate;      // Seconds-since-1904 time format.
  51. typedef double   arFloat;      // 64-bit floating point value.
  52.  
  53. typedef Integer arListID;       // "handle" to a virtual list of arNoteIDs.
  54. typedef void*     arPathID;      // "handle" to an object specifying a path
  55.                                       // into the document's tree of notes.
  56.  
  57. typedef void*     arWalkCache; // "handle" to an internal data structure used
  58.                                       // to optimize WalkPath calls.
  59.  
  60. /* This enum is returned from GetPathInfo; it describes the different
  61.  * types of path.
  62.  */
  63. enum arPathType { ptShelf,         // Path is rooted in the shelf of some window
  64.                         ptTopic,         // Path is rooted in a topic (normal case)
  65.                         ptInvalid }; // Path is invalid or undefined
  66.  
  67.  
  68. /* This enum is returned from certain calls which perform operations on
  69.  * the document file.
  70.  */
  71. enum arFileOpResult
  72.     {
  73.     fOK,                // The operation completed successfully.
  74.     fSoftError,        // The operation failed in a recoverable manner; the
  75.                         // document is OK.
  76.     fFatalError     // The operation failed messily; document has been closed.
  77.     };
  78.  
  79.  
  80. /* This enum is used as a parameter to various searching functions, to control
  81.  * the direction of search.
  82.  */
  83. enum arDirCode { dForward, dBackward };
  84.  
  85.  
  86. // This enum defines various options for the FindText function.
  87. enum arSearchFlags { sfMatchWords    = 1,      // Match entire words only
  88.                             sfWrapAround    = 2,      // Wrap around at the end of the document
  89.                             sfCaseSensitive = 4,      // Case is significant
  90.                             sfTopicScope    = 8 }; // Only search within a single topic
  91.  
  92.  
  93. // This enum defines flags used by the GetNoteState and SetNoteState functions.
  94. enum arNoteState { nsNoteOpen         = 1,      // Note is "open" - fields are shown.
  95.                          nsNoteExpanded = 2 }; // Note is "expanded" - subnotes are shown.
  96.  
  97.  
  98. /* This enum is used for the function result from GetSelection.  It specifies
  99.  * the nature of the selected objects, and defines the contents of the various
  100.  * 'OUT' parameters.
  101.  */
  102. enum arSelType
  103.     {
  104.     stNone,              // There is no current selection (or the selection is not
  105.                           // of any of the types listed below).
  106.     
  107.     stNote,              // A single note is selected.  The note parameter specifies
  108.                           // the note.
  109.     
  110.     stField,              // A single field instance is selected.  The note and field
  111.                           // parameters specify the field.
  112.     
  113.     stText,              // Some text is selected in a field instance.  selStart and
  114.                           // selEnd give the (0-based) range of selected characters;
  115.                           // all other parameters are defined as for stField.  If
  116.                           // there is a text insertion point, selStart and selEnd
  117.                           // will be equal.
  118.     
  119.     stFieldContents, // The contents of some non-textual field (e.g. a picture
  120.                           // or file-reference field) are selected.  Parameters are
  121.                           // defined as for stField.
  122.     
  123.     stMultipleNotes, // More than one note is selected.  All parameters are
  124.                           // undefined, except for selStart, which is overloaded to
  125.                           // contain the number of notes in the selection.  Use
  126.                           // GetSelEntry to access the selected notes.
  127.                           // 
  128.                           // This value may sometimes be returned from GetSelection
  129.                           // even when only one note is selected, if the note is not
  130.                           // selected under a specific path.
  131.     
  132.     stMultipleFields // More than one field instance is selected.  All parameters
  133.                           // are undefined, except for selStart, which is overloaded
  134.                           // to contain the number of field instances in the selection.
  135.                           // Use GetSelEntry to access the selected fields.
  136.                           // 
  137.                           // This value may sometimes be returned from GetSelection
  138.                           // even when only one field is selected, if the field is
  139.                           // not selected under a specific path.
  140.     }; // SelType
  141.  
  142.  
  143. // This enum defines the flags parameter to various SetFieldText calls.
  144. enum arSetFieldFlags { sfDoParse            = 1, // Compute numeric value from text
  145.                                                             // (for SetFieldText)
  146.                               sfDoFormat        = 1, // Compute text from numeric value
  147.                                                            // (for SetFieldDate/Number)
  148.                               sfDisableModDate = 2, // Don't update last-mod field
  149.                               nullSFF = 0 };
  150.  
  151.  
  152. enum arFieldType
  153.      {
  154.     arFTCheckbox = 0,
  155.     arFTNumber   = 2,
  156.     arFTDateTime = 3,
  157.     arFTText     = 4,
  158.     arFTNoteLink = 6,
  159.     arFTPicture  = 7,
  160.     arFTPopup    = 9,
  161.     arFTTime     = 10,
  162.     arFTFileRef  = 12,
  163.     arFTNull         = 999999 // end-of-list marker used in CBPromptForField.
  164.     };
  165.  
  166.  
  167. // Types used for GetFieldStyle and SetFieldStyle.
  168.  
  169. /* Note that full justification (jFull) is not supported in Arrange 2.0.
  170.  * If you pass in a justification of jFull it will be converted to jLeft.
  171.  */
  172. enum arJustCode { jLeft, jCenter, jRight, jFull };
  173.  
  174. // Style info that applies to an entire field
  175. struct arFieldStyle    
  176.     {
  177.     Short versNum;            // Version number for this record (currently 1).
  178.     Short pad;                // Unused (always zero).
  179.     arJustCode just;        // Text justification
  180.     }; // arFieldStyle
  181.  
  182. // Style info that applies to a particular range of characters in a field
  183. struct arCharStyle
  184.     {
  185.     Short    font;            // Font ID.
  186.     Short    size;            // Font size.
  187.     Short    style;        // Text style ("face", in QuickDraw nomenclature).
  188.     RGBColor color;        // Foreground text color.
  189.     Integer  charCount;    // Number of characters to which this record applies,
  190.     Integer  reserved;    // Reserved for future use (always set to 0),
  191.     }; // arCharStyle
  192.  
  193.  
  194. // Constants for the type field of an arSortClause record.
  195. enum { sAscending, sDescending };
  196.  
  197. struct arSortClause
  198.     {
  199.     Integer   type;  // Clause type - currently supports sAscending and sDescending.
  200.     arFieldID field; // Field to sort on.
  201.     }; // arSortClause
  202.  
  203.  
  204. // Constants for the type field of an arFilterClause record.
  205. enum { fEquals,             // Field value equal to filter value.
  206.          fNotEqual,             // Field value not equal to filter value.
  207.          fLess,                 // Field value < filter value.
  208.          fGreater,             // Field value > filter value.
  209.          fLessOrEqual,         // Field value <= filter value.
  210.          fGreaterOrEqual,     // Field value >= filter value.
  211.          fTextMatch,         // Field value has filter value as a substring.
  212.          fNoTextMatch,         // Negation of foTextMatch.
  213.          fPrefix,             // Field value has filter value as a prefix.
  214.          fNoPrefix,             // Negation of foPrefix.
  215.          fAnyValue };         // Any field value matches (as long as
  216.                                  // the field is present).
  217.  
  218.  
  219. struct arFilterClause
  220.     {
  221.     Integer     type;        // Clause type - accepts constants from enum above.
  222.     arFieldID field;        // Field to match in, or nil to match any field.
  223.     char         text[128]; // Text to match or compare against; not used for fAnyValue.
  224.                                 // For Boolean fields, first byte holds the Boolean
  225.                                 // value (0 or 1).
  226.     arDate     date;        // Date to match or compare against; used instead of
  227.                                 // text value for date/time and time fields for the
  228.                                 // comparison  operators (fEquals, fNotEqual, fLess,
  229.                                 // fGreater, fLessOrEqual, and fGreaterOrEqual).
  230.     arFloat     number;        // Number to match or compare against; used similarly
  231.                                 // to the date value, but for number fields.
  232.     }; // arFilterClause
  233.  
  234.  
  235. // Flags parameter for filter calls
  236. enum arFilterFlags
  237.     {
  238.     ffInvert = 1,            // Invert the result of the filter - i.e. accept notes
  239.                                 // which otherwise would not be accepted, and vice-versa.
  240.     ffOrClauses = 2,        // OR, rather than AND, the result of the individual
  241.                                 // filter clauses.
  242.     ffSearchSubnotes = 4    // Search (recursively) through the subnotes of the
  243.                                 // specified target notes.
  244.     };
  245.  
  246.  
  247. // This enum is used as a parameter to LookupObjectName.
  248. enum arObjectClass { arNoteType,
  249.                             arField,
  250.                             arFolder,
  251.                             arTopic,
  252.                             arView,
  253.                             arFTV };        // Match on folders, topics, and views.
  254.  
  255.  
  256. /* Miscellaneous information about a note - used as a parameter to GetNoteInfo
  257.  * and SetNoteInfo.
  258.  */
  259. struct arNoteInfo
  260.     {
  261.     Short versNum;                // Version number for this record (currently 1).
  262.     Short pad;                    // Unused (always zero).
  263.     
  264.     arDate createDate;        // Date/time when note was created.
  265.     arDate lastModDate;        // Date/time when note was last edited.
  266.     char   creatorName[64]; // User name when note was created.
  267.     char   editorName [64]; // Used name when note was last edited.
  268.     
  269.     Integer appearances;    // Number of places in which the note appears;
  270.                                     // -1 indicates count has overflowed.
  271.     
  272.     Short  hilightColor;    // Index into the list of icon hilighting colors;
  273.                                     // 0 indicates no hilighting.
  274.     Short  hilightIcon;     // Index into the list of superimposed display
  275.                                     // images over the note icon; 0 indicates no
  276.                                     // superimposed image.  (Not implemented in Arrange 2.0.)
  277.     }; // arNoteInfo
  278.  
  279.  
  280. /* Miscellaneous information about a folder, topic, or view - used as a
  281.  * parameter to GetTopicInfo and SetTopicInfo.
  282.  */
  283. struct arTopicInfo
  284.     {
  285.     Short versNum;              // Version number for this record (currently 1).
  286.     Short pad;                  // Unused (always zero).
  287.     
  288.     arObjectClass type;      // Which type of object this is (arFolder, arTopic,
  289.                                   // or arView).
  290.     char      name[64];      // Folder, topic, or view name
  291.     arTypeID  defaultType; // Default note type; nil if none.  Only used for topics.
  292.     arTopicID parent;          // Parent topic (for views) or folder (for topics and
  293.                                   // folders).  Nil for the document-root folder.
  294.     }; // arTopicInfo
  295.  
  296.  
  297. /* Miscellaneous information about a note type - used as a parameter to
  298.  * GetTypeInfo and SetTypeInfo.
  299.  */
  300. struct arTypeInfo
  301.     {
  302.     Short versNum;                // Version number for this record (currently 1).
  303.     Short pad;                    // Unused (always zero).
  304.     
  305.     char name[64];                // Type name
  306.     }; // arTypeInfo
  307.  
  308.  
  309. /* Miscellaneous information about a field definition - used as a
  310.  * parameter to GetFieldInfo and SetFieldInfo.
  311.  */
  312. struct arFieldInfo
  313.     {
  314.     Short versNum;                // Version number for this record (currently 1).
  315.     Short pad;                    // Unused (always zero).
  316.     
  317.     char name[64];                // Field name
  318.     arFieldType type;            // Field's contents type.
  319.     Boolean sortPopupOrder; // Sort-in-menu-order flag (for popup fields).
  320.     arTypeID matchType;        // Note type to match on (for note-link fields).
  321.     arFieldID matchField;    // Field to match in (for note-link fields).
  322.     }; // arFieldInfo
  323.  
  324.  
  325. /* Miscellaneous information about a window - used as a parameter to
  326.  * GetWindInfo and SetWindInfo.
  327.  */
  328. struct arWindInfo
  329.     {
  330.     Short versNum;                // Version number for this record (currently 1).
  331.     Short pad;                    // Unused (always zero).
  332.     
  333.     char    name[64];            // Window name
  334.     Rect      bounds;            // Window's display bounds (in global coordinates).
  335.     Boolean visible;            // False for hidden windows.
  336.     }; // arWindInfo
  337.  
  338.  
  339. /* Miscellaneous information about an Arrange document - used as a parameter
  340.  * to GetDocInfo.
  341.  */
  342. struct arDocInfo
  343.     {
  344.     Short versNum;            // Version number for this record (currently 1).
  345.     Short pad;                // Unused (always zero).
  346.     
  347.     FSSpec    docFile;        // File where document is stored (for titled documents).
  348.     Boolean  titled;        // True if document is "titled", i.e. is associated with
  349.                                 // a visible disk file.  False for newly created (or
  350.                                 // imported) documents which have never been saved.
  351.     Boolean  changed;        // True if document contains unsaved changes.
  352.     Boolean  readOnly;   // True if the document is open read-only.
  353.     Boolean  hidden;        // True for documents which are open invisibly (i.e.
  354.                                 // not visible in a document window or the Windows
  355.                                 // menu).
  356.     }; // arDocInfo
  357.  
  358.  
  359. // This enum is used as a parameter to GetBuiltInObject.
  360. enum arBuiltInObject
  361.     {
  362.     // Folders and topics.
  363.     boRootFolder,            // Root of the folder hierarchy (user-visible).
  364.     boOrganizerFolder,    // "Organizer" folder (user-visible).
  365.     boSystemFolder,        // System folder.
  366.     boNoteTypesTopic,        // Topic containing all note type definitions.
  367.     boFieldsTopic,            // Topic containing all field definitions.
  368.     boTrashFolder,            // Trash folder (user-visible).
  369.     boTrashTopic,            // Trash topic.
  370.     
  371.     // Note types.
  372.     boFieldDefType,        // Note type for field definitions.
  373.     boNoteDefType,            // Note type for note definitions.
  374.     boTopicType,            // Note type for folders, topics, and views.
  375.     boFilterType,            // Note type for filter specifications.
  376.     boFormType,                // Note type for form specifications.
  377.     boWindowSettingsType,// Note type for window objects.
  378.     boMemoType,                // Built-in "Memo" note type (user-visible).
  379.     
  380.     // Windows.
  381.     boNoteCatalogWindow, // Window object for the Note Catalog.
  382.     boFieldCatalogWindow,// Window object for the Field Catalog.
  383.     
  384.     // Fields for user-created notes.
  385.     boDateCreatedField,    // "Date created" field (date/time) (user-visible).
  386.     boDateModifiedField,    // "Date modified" field (date/time) (user-visible).
  387.     boCreatorField,        // "Creator name" field (text) (user-visible).
  388.     boEditorField,            // "Last editor name" field (text) (user-visible).
  389.     boNoteTextField,        // "Note text" field (text) (user-visible).
  390.     boNotePictField,        // Builtin picture field (picture).
  391.     boSubnotesField,        // Subnotes field (note link).
  392.     
  393.     // Fields for system objects in general.
  394.     boNameField,            // Name field for field defs, folders/topics/views,
  395.                                 // and windows (text).
  396.     
  397.     // Fields for type definitions.
  398.     boNoteTypeNameField, // Name field for note definitions (text).
  399.     boNoteTypeIconField,    // Icon field for note definitions (picture).
  400.     
  401.     // Fields for field definitions.
  402.     boDefaultValueField, // Default value field for field definitions (defined
  403.                                 // as a text field; actually takes the same type as
  404.                                 // the field it inhabits).
  405.     
  406.     // Fields for folders, topics, and views.
  407.     boTopicContentsField,// Contents of a topic or view, or topic list in a
  408.                                 // folder (note link).
  409.     boTopicViewsField,    // View list for a topic or folder (note link).
  410.     
  411.     // Fields for window objects.
  412.     boWindowShelfField,    // Shelf contents for this window (note link).
  413.     
  414.     // Extra fields for the document-root folder.
  415.     boDocWindowsField        // List of window objects for this document (note link).
  416.     }; // arBuiltInObject
  417.  
  418.  
  419. // This enum defines the flags parameter for the DisplayNotify routine.
  420. enum arNotifyFlags
  421.     {
  422.     nfShowImmediately = 1, // Show dialog immediately, rather than waiting for
  423.                                   // 0.5 seconds to elapse
  424.     nfUseThermometer  = 2, // Include a progress indicator in the dialog
  425.     nfForFrontWindow  = 4  // Show the dialog on the same monitor as the front
  426.                                   // window, rather than on the menu-bar monitor
  427.     };
  428.  
  429.  
  430. /* This enum defines the flags parameter for the PromptForField and
  431.  * PromptForType functions.
  432.  */
  433. enum arChoiceDialogFlags
  434.     {
  435.     cdAllowAny       = 1, // Allow an "Any Field" or "Any Type" option
  436.     cdAllowBlank     = 2, // Allow a blank (nil) result
  437.     cdAllowDefineNew = 4  // Allow the user to create a new field or note type
  438.     }; // arChoiceDialogFlags
  439.  
  440.  
  441. /* This enum specifies the values to pass for the menuCode parameter to
  442.  * the AddMenu and AddMenuItem callbacks.
  443.  */
  444. enum arMenuID
  445.     {
  446.     mMenuBar,
  447.     // apple menu
  448.         mPluginAbout = 1,
  449.     mFile,
  450.         mPreferences,
  451.     mEdit,
  452.         mSelect,
  453.         mOutline,
  454.     mSearch,
  455.     mNotes,
  456.     mTopics,
  457.         mContents,
  458.     mViews,
  459.         mViewUpdate,
  460.     mText,
  461.         mFont,
  462.         mColor,
  463.     mWindows,
  464.     mFileRef,
  465.     mTools
  466.     }; // arMenuID
  467.  
  468.  
  469. /* This enum lists various locations in an Arrange document window where the
  470.  * user might click.  It is used as a parameter to a ClickHook function.
  471.  * Three of the ClickHook parameters - "note", "field", and "path", are only
  472.  * used for some of the enum values.  These are listed in parenthesis after
  473.  * the description of each enum value.
  474.  */
  475. enum arClickLocation
  476.     {
  477.     clNoteIcon,                    // A note icon                                (note,path)
  478.     clNoteControl,                // A note's fold control                (note,path)
  479.     clFieldName,                // A field label                            (note,field,path)
  480.     clFieldContents,            // The contents of a field                (note,field,path)
  481.     
  482.     clTimeDisplay,                // Time/date display in topic header
  483.     clTopicHeader,                // Rest of the topic header
  484.     clViewClose,                // Close box in the view header
  485.     clViewTrash,                // Trash can in the view header
  486.     clViewHeader,                // Rest of the view header
  487.     clCalendarHeader,            // Calendar header,
  488.     
  489.     clWindowTitle,                // Window title bar
  490.     clWindowClose,                // Window close box
  491.     clWindowZoom,                // Window zoom box
  492.     clWindowGrow,                // Window grow icon
  493.     
  494.     clContentsHeader,            // Contents header bar
  495.     clShelfHeader,                // Shelf header bar
  496.     clContentsName,            // topic/fldr name in Contents        (note)
  497.     clContentsIcon,            // topic/fldr icon in Contents        (note)
  498.     clShelfNote,                // name in Shelf                            (note)
  499.     clShelfIcon                    // icon in Shelf                            (note)
  500.     };
  501.  
  502.  
  503. // This enum is used as a parameter to the FieldHook hook function.
  504. enum arFieldAction
  505.     {
  506.     faEntry,           // The field's contents are being activated.
  507.     faExit,           // The field's contents have been deactivated.
  508.     faUpdate,       // The active field's contents are about to be written back
  509.                        // to the data layer.
  510.     faKeystroke,   // The user has typed a key in the text.
  511.     faBackspace,   // The user has typed the backspace or delete key.
  512.     faSelChange,   // The user has made a selection change (with the mouse or
  513.                        // arrow keys).
  514.     faEditCmd,       // The user has issued an editing command such as Cut, Paste,
  515.                        // or Clear.
  516.     faPopupChoice, // The user has made a choice in the field's popup menu
  517.                        // (Popup fields only)
  518.     faSetFormat,    // The hook has been chosen as the "format" for the field.
  519.     faUnsetFormat, // The hook has been deselected as the "format" for the field.
  520.     faAddAction,    // The hook has been added to the set of "actions" for the field.
  521.     faRemoveAction // The hook has been removed from the set of "actions" for the
  522.                         // field.
  523.     }; // arFieldAction
  524.  
  525.  
  526. // This enum is used as a parameter to the TopicHook hook function.
  527. enum arTopicAction
  528.     {
  529.     taSwitchTopic,            // The current topic/folder/view in the active window
  530.                                 // has changed
  531.     taSwitchWindow            // The active window has changed
  532.     }; // arTopicAction
  533.  
  534.  
  535. // This enum is used as a parameter to the FileHook hook function.
  536. enum arFileAction
  537.     {
  538.     faNewBlank,     // A "raw" new file has been created
  539.     faNew,         // A new document has been created from a stationery file
  540.     faOpen,         // An existing document or TAIL file has been opened
  541.     faClose,         // A document is about to be closed; an arHookResult of false
  542.                      // will cancel the operation and prevent it from being
  543.                      // closed.  Note that FileHooks are not called when a
  544.                      // document is closed due to an error condition (e.g. disk
  545.                      // error accessing the file).
  546.     faSave,         // An existing, titled file is about to be saved
  547.     faSaveAs,     // A document is about to be saved into a new file
  548.     faRevert         // A document has just been reverted to its saved state
  549.     }; // arFileAction
  550.  
  551.  
  552. // This enum is used as a parameter to the RegisterFieldProc callback function.
  553. enum arFPType { fpFormat,     // Register a field-format proc.
  554.                      fpAction }; // Register a field-action proc.
  555.  
  556.  
  557. // This enum is used as a parameter to the RegisterExportFormat callback function.
  558. enum arEFType { efSaveAs,     // Register a Save As format.
  559.                      efExport }; // Register an Export format.
  560.  
  561.  
  562. #if defined (__SC__) || defined (__MWERKS__)
  563.     #define arClickLocation     long
  564.     #define arFieldAction       long
  565.     #define arTopicAction       long
  566.     #define arFileAction        long
  567.     #define arEFType            long
  568.     #define arFPType            long
  569.     #define arSetFieldFlags     long
  570.     #define arDirCode           long
  571.     #define arSearchFlags       long
  572.     #define arFilterFlags       long
  573.     #define arBuiltInObject     long
  574.     #define arObjectClass       long
  575.     #define arChoiceDialogFlags long
  576.     #define arNotifyFlags       long
  577.     
  578.     typedef long pARNoteState;
  579.     typedef long pARFieldType;
  580. #else
  581.     typedef arFieldType pARFieldType;
  582.     typedef arNoteState pARNoteState;
  583. #endif
  584.  
  585.  
  586. typedef Boolean arHookResult;
  587. typedef arHookResult (*ClickHook) ( ModuleParamBlock* pb, arClickLocation loc,
  588.                                                 Point where, pShort modifiers, pShort clickCount,
  589.                                                 arNoteID note, arFieldID field, arPathID path ENDP );
  590. typedef arHookResult (*KeyHook)     ( ModuleParamBlock* pb, pShort theChar, pShort key,
  591.                                                 pShort modifiers ENDP );
  592. typedef arHookResult (*MenuHook)  ( ModuleParamBlock* pb, Integer commandCode,
  593.                                                Integer commandParam, pShort modifiers ENDP );
  594. typedef arHookResult (*FieldHook) ( ModuleParamBlock* pb, arNoteID note,
  595.                                                arFieldID field, arFieldAction action,
  596.                                                const char* choiceText ENDP );
  597. typedef void           (*TopicHook) ( ModuleParamBlock* pb, arTopicID newTopic,
  598.                                                arWindowID newWindow, arTopicAction action ENDP );
  599. typedef void           (*TickHook)  ( ModuleParamBlock* pb ENDP );
  600. typedef arHookResult (*FileHook)  ( ModuleParamBlock* pb, arFileAction action ENDP );
  601. typedef arHookResult (*QuitHook)  ( ModuleParamBlock* pb ENDP );
  602. typedef void           (*AboutToMenuHook)(ModuleParamBlock* pb ENDP);
  603. typedef Integer      (*ImportHook)( ModuleParamBlock* pb, const FSSpec *file,
  604.                                               pShort fRefnum, Integer formatID,
  605.                                               pBoolean sniff, arTopicID destTopic ENDP );
  606. typedef Integer       (*ExportHook)( ModuleParamBlock* pb, const FSSpec *file,
  607.                                                pShort fRefnum, Integer formatID,
  608.                                                arEFType type, arTopicID srcTopic ENDP );
  609.  
  610. typedef Integer      (*ClippingsConversionHook)( ModuleParamBlock* pb,
  611.                                                 arNoteID fromNote, pBoolean sniff, arNoteID* destNote ENDP );
  612.  
  613.  
  614. /* This struct lists the callback functions for reading and writing data
  615.  * from field instances.
  616.  */
  617. struct DataCalls
  618.     {
  619.     Short vers;    // Version number for this record (currently 2).
  620.     Short pad;    // Unused (always 0).
  621.     
  622.     // Read calls
  623.     Integer         (*GetFieldTextLen)    (arNoteID note, arFieldID field ENDP);
  624.     Integer         (*GetFieldText)        ( arNoteID note, arFieldID field,
  625.                                                   Integer bufLen, OUT void* buffer ENDP );
  626.     arDate         (*GetFieldDate)        (arNoteID note, arFieldID field ENDP);
  627.     arFloat         (*GetFieldNumber)    (arNoteID note, arFieldID field ENDP);
  628.     
  629.     Integer         (*GetFieldListLen)    (arNoteID note, arFieldID field ENDP);
  630.     arNoteID         (*GetFieldListEntry)( arNoteID note, arFieldID field,
  631.                                                   Integer index ENDP );
  632.     OWN arListID (*GetFieldList)        (arNoteID note, arFieldID field ENDP);
  633.     
  634.     OWN PicHandle    (*GetFieldPict)    (arNoteID note, arFieldID field ENDP);
  635.     OWN Handle     (*GetFieldAlias)        (arNoteID note, arFieldID field ENDP);
  636.     
  637.     // Write calls
  638.     void (*SetFieldText)            ( arNoteID note, arFieldID field, const char* text,
  639.                                           Integer textLen, arSetFieldFlags flags ENDP );
  640.     void (*SetFieldDate)            ( arNoteID note, arFieldID field, arDate date,
  641.                                           arSetFieldFlags flags ENDP );
  642.     void (*SetFieldNumber)        ( arNoteID note, arFieldID field,
  643.                                           const arFloat *number, arSetFieldFlags flags ENDP );
  644.     void (*SetFieldList)            ( arNoteID note, arFieldID field, arListID list,
  645.                                           arSetFieldFlags flags ENDP );
  646.     void (*AddListFieldEntry)    ( arNoteID note, arFieldID field, Integer index,
  647.                                           arNoteID childNote, arSetFieldFlags flags ENDP );
  648.     void (*DeleteListFieldEntry)( arNoteID note, arFieldID field, arNoteID childNote,
  649.                                           arSetFieldFlags flags ENDP );
  650.     void (*MoveListFieldEntry)    ( arNoteID note, arFieldID field, arNoteID childNote,
  651.                                           Integer index, arSetFieldFlags flags ENDP );
  652.     void (*SetFieldPict)            ( arNoteID note, arFieldID field, PicHandle pict,
  653.                                           arSetFieldFlags flags ENDP );
  654.     void (*SetFieldAlias)        ( arNoteID note, arFieldID field, Handle alias,
  655.                                           arSetFieldFlags flags ENDP );
  656.  
  657.     // Functions added in version 2 of DataCalls record
  658.     void    (*ReplaceFieldText)( arNoteID note, arFieldID field,
  659.                                           Integer repStart, Integer repEnd,
  660.                                           const char* insText, arSetFieldFlags flags ENDP );
  661.     Integer (*GetFieldStyle)   ( arNoteID note, arFieldID field,
  662.                                           OUT arFieldStyle* fieldStyle,
  663.                                           Integer bufLen, OUT arCharStyle* charStyles ENDP );
  664.     void    (*SetFieldStyle)   ( arNoteID note, arFieldID field,
  665.                                          const arFieldStyle* fieldStyle,
  666.                                          Integer charStyleCount,
  667.                                          const arCharStyle* charStyles,
  668.                                           arSetFieldFlags flags ENDP );
  669.     
  670.     // Functions added in version 3 of DataCalls record
  671.     pBoolean (*GetFieldBool) ( arNoteID note, arFieldID field ENDP );
  672.     void       (*SetFieldBool) ( arNoteID note, arFieldID field,
  673.                                        const pBoolean value,
  674.                                         arSetFieldFlags flags ENDP );
  675.     }; // DataCalls
  676.  
  677.  
  678. /* This struct lists the callback functions for creating and destroying notes
  679.  * and managing their fields.
  680.  */
  681. struct NoteCalls
  682.     {
  683.     Short vers; // Version number for this record (currently 1).
  684.     Short pad;  // Unused (always 0).
  685.     
  686.     arNoteID        (*CreateNote)            ( arTypeID type, pBoolean doGather ENDP );
  687.     arNoteID        (*DuplicateNote)        ( arNoteID note, pBoolean doGather ENDP );
  688.     void            (*ConvertNote)            ( arNoteID note, arTypeID type,
  689.                                                   pBoolean doGather ENDP );
  690.     void            (*DestroyNote)            ( arNoteID note ENDP );
  691.     
  692.     void            (*AddField)                ( arNoteID note, arFieldID field,
  693.                                                   arFieldID nextField ENDP );
  694.     void            (*RemoveField)            ( arNoteID note, arFieldID field ENDP );
  695.     void            (*HideField)            ( arNoteID note, arFieldID field ENDP );
  696.     void            (*MoveField)            ( arNoteID note, arFieldID field,
  697.                                                   arFieldID nextField ENDP );
  698.     
  699.     Integer        (*CountNoteFields)    ( arNoteID note ENDP );
  700.     arFieldID    (*GetNoteField)        ( arNoteID note, Integer index ENDP );
  701.     Boolean        (*NoteHasField)        ( arNoteID note, arFieldID field,
  702.                                                   pBoolean onlyIfVisible ENDP );
  703.     
  704.     Boolean        (*NoteExists)            ( arNoteID note ENDP );
  705.     arTypeID        (*GetNoteType)            ( arNoteID note ENDP );
  706.     
  707.     void            (*GetNoteInfo)            ( arNoteID note, IO    arNoteInfo *info ENDP );
  708.     void            (*SetNoteInfo)            ( arNoteID note, const arNoteInfo *info ENDP );
  709.     }; // NoteCalls
  710.  
  711.  
  712. /* This struct lists the callback functions for inspecting and altering the
  713.  * selection.
  714.  */
  715. struct SelCalls
  716.     {
  717.     Short vers; // Version number for this record (currently 2).
  718.     Short pad;  // Unused (always 0).
  719.     
  720.     arWindowID    (*GetActiveWindow) ();
  721.     
  722.     arSelType    (*GetSelection)     ( OUT arNoteID *note, OUT arFieldID *field,
  723.                                                OUT Integer *selStart, OUT Integer *selEnd ENDP );
  724.     OWN arPathID(*GetSelPath)         ( );
  725.     void            (*GetSelEntry)         ( Integer index, OUT arNoteID *note,
  726.                                                OUT arFieldID *field,
  727.                                                 OUT arNoteID *parentNote ENDP );
  728.     
  729.     void            (*SelectObject)     ( arNoteID parent, arFieldID field,
  730.                                                arNoteID note, pBoolean doDeselect ENDP );
  731.     Boolean        (*ObjectIsSelected)( arNoteID parent, arFieldID field,
  732.                                                 arNoteID note ENDP );
  733.     Boolean        (*FlushSelection)     ( pBoolean alsoDrop ENDP );
  734.     
  735.     void            (*ShowPath)             ( arPathID path, pBoolean selectFlag,
  736.                                                Integer textSelStart, Integer textSelEnd ENDP );
  737.     
  738.     Integer        (*GetSelText)         ( Integer bufLen, OUT void* buffer,
  739.                                                 OUT Integer *selStart, OUT Integer *selEnd ENDP );
  740.     void            (*SetSelText)         ( const char* text, Integer textLen,
  741.                                                 Integer selStart, Integer selEnd ENDP );
  742.     
  743.     // Functions added in version 2 of SelCalls record
  744.     void      (*ReplaceSelText) ( const char* text, const char* undoName ENDP );
  745.     }; // SelCalls
  746.  
  747.  
  748. /* This struct lists the callback functions for searching, sorting, and
  749.  * filtering.
  750.  */
  751. struct SearchCalls
  752.     {
  753.     Short vers; // Version number for this record (currently 1).
  754.     Short pad;  // Unused (always 0).
  755.     
  756.     // Searching
  757.     Boolean (*NextAppearance)( IO arPathID path, arDirCode direction ENDP );
  758.     Boolean (*FindText)         ( IO arPathID path, arDirCode direction,
  759.                                         IO Integer *selStart, IO Integer *selEnd,
  760.                                         const char* searchString, arSearchFlags flags ENDP );
  761.     
  762.     // Filtering and sorting
  763.     OWN arListID (*FilterList)  ( arListID list, arTypeID matchType,
  764.                                             arFilterFlags flags, pShort clauseCount,
  765.                                             const arFilterClause* clauses ENDP );
  766.     OWN arListID (*FilterNotes) ( arTypeID type, arFilterFlags flags,
  767.                                             pShort clauseCount,
  768.                                             const arFilterClause* clauses ENDP );
  769.     OWN arListID (*SortNotes)   ( arListID list, pShort clauseCount,
  770.                                             const arSortClause* clauses ENDP );
  771.     }; // SearchCalls
  772.  
  773.  
  774. /* This struct lists the callback functions for creating and accessing
  775.  * system objects (i.e. topics, note type definitions, and so forth).
  776.  */
  777. struct SysObjCalls
  778.     {
  779.     Short vers; // Version number for this record (currently 1).
  780.     Short pad;  // Unused (always 0).
  781.     
  782.     // General calls
  783.     arNoteID         (*GetBuiltInObject)    ( arBuiltInObject whichObject ENDP );
  784.     arNoteID         (*LookupObjectName)    ( arObjectClass objClass, const char* name,
  785.                                                   pBoolean allowPartial ENDP );
  786.     
  787.     // Topic/folder/view calls
  788.     arTopicID     (*CreateTopic)        ( const char* name, arTopicID parent,
  789.                                                   arTopicID successor, pBoolean makeView ENDP );
  790.     arTopicID     (*CreateFolder)        ( const char* name, arTopicID successor ENDP );
  791.     void             (*UpdateView)            ( arTopicID view ENDP );
  792.     void             (*GetTopicInfo)        ( arTopicID topic, IO arTopicInfo *info ENDP );
  793.     void             (*SetTopicInfo)        ( arTopicID topic, const arTopicInfo *info ENDP );
  794.     
  795.     // Note type calls
  796.     arTypeID         (*CreateNoteType)    ( const char* name, pBoolean userVisible ENDP );
  797.     Integer         (*CountTypeInstances)( arTypeID type ENDP );
  798.     OWN arListID (*GetTypeInstances)    ( arTypeID type ENDP );
  799.     void             (*GetTypeInfo)        ( arTypeID type, IO arTypeInfo *info ENDP );
  800.     void             (*SetTypeInfo)        ( arTypeID type, const arTypeInfo *info ENDP );
  801.     
  802.     // Field calls
  803.     arFieldID     (*CreateField)        ( const char* name, pARFieldType dataType,
  804.                                                   pBoolean userVisible ENDP );
  805.     void             (*GetFieldInfo)        ( arFieldID field, IO arFieldInfo *info ENDP );
  806.     void             (*SetFieldInfo)        ( arFieldID field, const arFieldInfo *info ENDP );
  807.     
  808.     // Window calls
  809.     arWindowID     (*CreateWindow)        ( const char* name, const Rect *bounds ENDP );
  810.     arTopicID     (*GetCurrentTopic)    ( arWindowID window, pBoolean returnRoot ENDP );
  811.     Boolean         (*SetCurrentTopic)    ( arWindowID window, arTopicID topic,
  812.                                                   pBoolean useLastView ENDP );
  813.     Boolean         (*SelectWindow)        ( arWindowID window ENDP );
  814.     void             (*GetWindInfo)        ( arWindowID window, IO arWindInfo *info ENDP );
  815.     void             (*SetWindInfo)        ( arWindowID window, const arWindInfo *info ENDP );
  816.     }; // SysObjCalls
  817.  
  818.  
  819. /* This struct lists the callback functions for manipulating arListIDs and
  820.  * arPathIDs.
  821.  */
  822. struct ListCalls
  823.     {
  824.     Short vers; // Version number for this record (currently 1).
  825.     Short pad;  // Unused (always 0).
  826.     
  827.     // List access
  828.     Integer        (*GetListLen)        ( arListID list ENDP );
  829.     arNoteID        (*GetListEntry)    ( arListID list, Integer index ENDP );
  830.     Integer        (*GetListEntries)    ( arListID list, Integer index,
  831.                                               OUT arNoteID* buffer, Integer bufSize ENDP );
  832.     Integer        (*SearchList)        ( arListID list, arNoteID target ENDP );
  833.     
  834.     // List editing
  835.     void            (*SetListEntry)    ( IO arListID *list, Integer index,
  836.                                               arNoteID entry ENDP );
  837.     void            (*SetListEntries)    ( IO arListID *list, Integer index,
  838.                                               const arNoteID* entries, Integer count ENDP );
  839.     void            (*InsertListEntry)    ( IO arListID *list, Integer index,
  840.                                                   arNoteID entry ENDP );
  841.     void            (*InsertListEntries) ( IO arListID *list, Integer index,
  842.                                                   Integer count ENDP );
  843.     void            (*DeleteListEntries) ( IO arListID *list, Integer index,
  844.                                                   Integer count ENDP );
  845.     void            (*ResizeList)            ( IO arListID *list, Integer newSize ENDP );
  846.     
  847.     // Miscellaneous list operations
  848.     OWN arListID (*CreateList)     ( Integer length ENDP );
  849.     OWN arListID (*DupList)         ( OWN arListID list ENDP );
  850.     void             (*DisposeList) ( OWN arListID list ENDP );
  851.     
  852.     // Path access
  853.     arPathType    (*GetPathInfo)        ( arPathID path, OUT arNoteID *root ENDP );
  854.     Integer        (*GetPathLen)        ( arPathID path ENDP );
  855.     arNoteID        (*GetPathEntry)    ( arPathID path, Integer index ENDP );
  856.     
  857.     // Path manipulation
  858.     Boolean        (*PushPath)            ( arPathID path, arNoteID newEntry ENDP );
  859.     void            (*PopPath)            ( arPathID path ENDP );
  860.     Boolean        (*WalkPath)            ( arPathID path, arDirCode direction,
  861.                                               IO arWalkCache* cache ENDP );
  862.     void            (*DisposeWalkCache)( arWalkCache cache ENDP );
  863.     
  864.     // Miscellaneous path operations
  865.     OWN arPathID (*PathToTopic)    ( arTopicID topic, pBoolean atEnd ENDP );
  866.     Boolean         (*EqualPaths)        ( arPathID path1, arPathID path2 ENDP );
  867.     OWN arPathID (*DupPath)            ( arPathID path ENDP );
  868.     void             (*DisposePath)    ( arPathID path ENDP );
  869.     }; // ListCalls
  870.  
  871.  
  872. /* This struct lists the callback functions for manipulating the display
  873.  * state (scrolling, opening and closing notes, etc.).
  874.  */
  875. struct ViewCalls
  876.     {
  877.     Short vers; // Version number for this record (currently 1).
  878.     Short pad;  // Unused (always 0).
  879.     
  880.     arNoteState (*GetNoteState) ( arNoteID note, arNoteID parentNote ENDP );
  881.     void            (*SetNoteState) ( arNoteID note, arNoteID parentNote,
  882.                                             pARNoteState newState ENDP );
  883.     }; // ViewCalls
  884.  
  885.  
  886. /* This struct lists the callback functions for document-level operations
  887.  * (e.g. opening, closing and saving documents).
  888.  */
  889. struct DocCalls
  890.     {
  891.     Short vers; // Version number for this record (currently 1).
  892.     Short pad;  // Unused (always 0).
  893.     
  894.     arDocumentPtr    (*GetCurrentDoc)    ();
  895.     void                (*SetCurrentDoc)    (arDocumentPtr newDoc ENDP);
  896.     
  897.     Integer            (*CountOpenDocs)    ();
  898.     arDocumentPtr    (*GetIndexedDoc)    (Integer index ENDP);
  899.     arDocumentPtr  (*GetPrefsDoc)    ();
  900.     
  901.     void                (*GetDocInfo)        (IO arDocInfo *info ENDP);
  902.     
  903.     arDocumentPtr    (*NewDoc)            ( const FSSpec* stationeryFile,
  904.                                                   const char* title  ENDP);
  905.     arDocumentPtr    (*Open)                (const FSSpec* srcFile, pBoolean readOnly ENDP);
  906.     void                (*Close)                ();
  907.     
  908.     arFileOpResult    (*Save)                ();
  909.     arFileOpResult    (*SaveAs)            (const FSSpec* targetFile ENDP);
  910.     arFileOpResult    (*Revert)            ();
  911.     
  912.     Integer            (*GetGlobalData)  ( const char* name, Integer bufLen,
  913.                                                   OUT void* buffer  ENDP);
  914.     void                (*SetGlobalData)  ( const char* name, const void* data,
  915.                                                   Integer dataLen, pBoolean isText  ENDP);
  916.     
  917.     Boolean            (*BringCurDocToFront) ();
  918.     void                (*SetChangedFlag)         ();
  919.     void                (*SetupUndo)             ( const char* operationName,
  920.                                                         pBoolean setChangedFlag ENDP );
  921.     
  922.     void                (*OpenHiddenDoc)    ( const FSSpec* srcFile, pBoolean readOnly,
  923.                                                   OUT arDocumentPtr* doc,
  924.                                                   OUT Boolean* closeWhenFinished ENDP );
  925.     }; // DocCalls
  926.  
  927.  
  928. /* This struct lists the callback functions for accessing and extending
  929.  * Arrange's import and export capabilities.
  930.  */
  931. struct IOCalls
  932.     {
  933.     Short vers; // Version number for this record (currently 1).
  934.     Short pad;  // Unused (always 0).
  935.     
  936.     Boolean    (*ImportTAIL) (const FSSpec* srcFile,    arTopicID destTopic ENDP);
  937.     Boolean    (*ExportTAIL) (const FSSpec* targetFile, arTopicID srcTopic  ENDP);
  938.     }; // IOCalls
  939.  
  940.  
  941. /* This struct lists the callback functions for calling and overriding Arrange
  942.  * commands.
  943.  */
  944. struct CmdCalls
  945.     {
  946.     Short vers; // Version number for this record (currently 1).
  947.     Short pad;  // Unused (always 0).
  948.     }; // CmdCalls
  949.  
  950.  
  951. /* This struct lists the callback functions for customizing the Arrange user
  952.  * interface.
  953.  */
  954. struct UICalls
  955.     {
  956.     Short vers; // Version number for this record (currently 1).
  957.     Short pad;  // Unused (always 0).
  958.     
  959.     void (*AddMenu)            ( const char* menuName, pShort menuCode,
  960.                                       Integer parentCode ENDP );
  961.     void (*AddMenuItem)        ( pShort menuCode, const char* itemName, pShort cmdChar,
  962.                                       Integer commandCode, Integer itemRefcon ENDP );
  963.     void (*DeleteMenuItem)    ( pShort menuCode, Integer commandCode,
  964.                                       Integer itemRefcon ENDP );
  965.     void (*SetMenuItem)        ( pShort menuCode, Integer commandCode,
  966.                                       Integer itemRefcon, const char* itemName,
  967.                                       pBoolean itemEnabled, pShort markChar,
  968.                                       pShort itemStyle ENDP );
  969.     
  970.     void (*SetClickHook)        ( ClickHook hook, uInteger refcon, pBoolean addHook ENDP );
  971.     void (*SetMenuHook)        ( MenuHook hook, uInteger refcon, pBoolean addHook,
  972.                                       Integer commandCode ENDP );
  973.     void (*SetKeyHook)       ( KeyHook hook, uInteger refcon, pBoolean addHook,
  974.                                       pShort charFilter, pShort keyFilter,
  975.                                       pShort modFilter ENDP );
  976.     void (*SetFieldHook)        ( FieldHook hook, uInteger refcon, pBoolean addHook,
  977.                                       arFieldID field ENDP );
  978.     void (*SetTopicHook)        ( TopicHook hook, uInteger refcon, pBoolean addHook ENDP );
  979.     void (*SetTickHook)        ( TickHook  hook, uInteger refcon, pBoolean addHook ENDP );
  980.     void (*SetFileHook)        ( FileHook  hook, uInteger refcon, pBoolean addHook ENDP );
  981.     void (*SetQuitHook)        ( QuitHook  hook, uInteger refcon, pBoolean addHook ENDP );
  982.     
  983.     void (*SetATMHook)        ( AboutToMenuHook hook, uInteger refcon,
  984.                                       pBoolean addHook ENDP );
  985.     
  986.     void (*RegisterImportFormat) ( const char* name, Integer formatID,
  987.                                              OSType* fileTypes, Integer fileTypeCount,
  988.                                              ImportHook hook, uInteger refcon ENDP );
  989.     
  990.     void (*RegisterExportFormat) ( const char* name, Integer formatID,
  991.                                              arEFType type, ExportHook hook,
  992.                                              uInteger refcon, OSType fileType,
  993.                                              OSType fileCreator ENDP );
  994.     
  995.     void (*RegisterFieldProc)( const char* name, Integer id, arFPType type,
  996.                                         Integer fieldTypes, FieldHook proc,
  997.                                         uInteger refcon ENDP );
  998.     Boolean (*TestFieldProc) ( arFieldID field, arFPType type, Integer procID ENDP );
  999.     }; // UICalls
  1000.  
  1001.  
  1002. /* This struct lists the callback functions for displaying dialogs and
  1003.  * progress indicators.
  1004.  */
  1005. struct DialogCalls
  1006.     {
  1007.     Short vers; // Version number for this record (currently 1).
  1008.     Short pad;  // Unused (always 0).
  1009.     
  1010.     void        (*StopAlert)            ( const char* message ENDP );
  1011.     Boolean    (*OKCancelAlert)        ( const char* message ENDP );
  1012.     Boolean    (*PromptForString)    ( const char* prompt, IO char* string,
  1013.                                               pShort maxLen, pBoolean numbersOnly ENDP );
  1014.     
  1015.     Boolean  (*PromptForField)    ( const char* prompt, IO arFieldID* field,
  1016.                                               const arFieldType* allowedTypes,
  1017.                                               arChoiceDialogFlags flags ENDP );
  1018.     Boolean  (*PromptForType)     ( const char* prompt, IO arTypeID* type,
  1019.                                               arChoiceDialogFlags flags ENDP );
  1020.     
  1021.     void        (*DisplayNotify)        (const char* message, arNotifyFlags flags ENDP);
  1022.     void        (*ClearNotify)            ();
  1023.     void        (*SetNotifyText)        (const char* newMessage ENDP);
  1024.     
  1025.     Boolean    (*TickNotify)            (Integer amountDone, Integer totalAmount ENDP);
  1026.     
  1027.     void        (*BackgroundTick)        ();
  1028.     }; // DialogCalls
  1029.  
  1030.  
  1031. /* This struct lists the callback functions for new functions added in DayVision 1.0.
  1032.     Sorry the name isn't more descriptive but backward compatibility doesn't allow
  1033.     organizing these as I would otherwise have liked...
  1034.  */
  1035. struct WA15Calls
  1036.     {
  1037.     Short vers; // Version number for this record (currently 1).
  1038.     Short pad;  // Unused (always 0).
  1039.     
  1040.     void (*SetClippingsConversionHook)    ( ClippingsConversionHook hook, uInteger refcon, pBoolean addHook ENDP );
  1041.     }; // WA15Calls
  1042.  
  1043.  
  1044. enum    {    cbtArrangeVers = 1,
  1045.             cbtWebArranger15Vers };
  1046.  
  1047. /* This struct defines the Arrange-specific extensions to the standard set
  1048.  * of callback functions.
  1049.  */
  1050. class ArrangeCallbackTbl : public CallbackTbl
  1051.     {
  1052. public:
  1053.     ArrangeCallbackTbl();
  1054.     
  1055.     Short aVers;                    // Version number for Arrange callback extensions
  1056.                                         // cbtArrangeVers = Arrange (WA15Calls does not exist)
  1057.                                         // cbtWebArranger15Vers = WebArranger 1.5 (WA15Calls is filled out)
  1058.     Short aPad;                        // Unused (always 0).
  1059.           DataCalls*   data;   // Data manipulation calls.
  1060.           NoteCalls*   notes;  // Note manipulation calls.
  1061.           SelCalls*    sel;    // Selection access and manipulation.
  1062.           SearchCalls* search; // Search, filter, and sorting calls.
  1063.           SysObjCalls* sysObj; // Calls to manipulate system objects.
  1064.           ListCalls*     list;    // Calls to manipulate lists and paths.
  1065.           ViewCalls*   view;    // Calls to manipulate view state (scrolling,
  1066.                                         // opening/closing notes, etc.).
  1067.           DocCalls*    doc;    // Document-level operations.
  1068.           IOCalls*         io;        // Import and export customization.
  1069.           CmdCalls*     cmd;        // Command overriding, undo setup.
  1070.           UICalls*     ui;        // UI customization.
  1071.           DialogCalls* dlg;        // Dialogs and notification.
  1072.             WA15Calls*   wa15Calls;    // Calls introduced in WebArranger 1.5
  1073.     
  1074. private:
  1075.     DataCalls    pData;
  1076.     NoteCalls    pNotes;
  1077.     SelCalls        pSel;
  1078.     SearchCalls    pSearch;
  1079.     SysObjCalls    pSysObj;
  1080.     ListCalls    pList;
  1081.     ViewCalls    pView;
  1082.     DocCalls        pDoc;
  1083.     IOCalls        pIO;
  1084.     CmdCalls        pCmd;
  1085.     UICalls        pUI;
  1086.     DialogCalls    pDlg;
  1087.     WA15Calls    pWA15Calls;
  1088.     
  1089.     friend void InitSeg1Callbacks(IO ArrangeCallbackTbl& table);
  1090.     friend void InitSeg2Callbacks(IO ArrangeCallbackTbl& table);
  1091.     }; // ArrangeCallbackTbl
  1092.  
  1093.  
  1094. #endif // ifndef ARRANGECALLBACKS_H